import 'package:flutter/cupertino.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';

class SettingsPageViewModel extends ChangeNotifier {
  bool? _notificationFlag = false;

  bool? get notificationFlag {
    return _notificationFlag;
  }

  void changeNotificationFlag(bool newValue) {
    _notificationFlag = newValue;
    notifyListeners();
  }

  Future<void> fetchNotification() async {
    _notificationFlag = await JPush().isNotificationEnabled();
    notifyListeners();
  }
}
